//
//  MSUpArrowSprite.m
//  MagicSword
//
//  Created by Netease on 15/12/3.
//  Copyright © 2015年 Jonear. All rights reserved.
//

#import "MSUpArrowSprite.h"

@implementation MSUpArrowSprite

- (id)init {
    self = [super initWithImageNamed:@"main_up"];
    if (self) {
        [self setSize:CGSizeMake(30, 30)];
    }
    
    return self;
}

- (void)runAction {
    SKAction *action1 = [SKAction moveToY:CGRectGetMidY(self.frame)-3 duration:0.2];
    SKAction *action2 = [SKAction moveToY:CGRectGetMidY(self.frame) duration:0.2];
    SKAction *action = [SKAction sequence:@[action1, action2]];
    [self runAction:[SKAction repeatAction:action count:INT32_MAX]];
}

@end
